package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.UserDisplayRulesMapper;
import com.ruoyi.system.domain.UserDisplayRules;
import com.ruoyi.system.service.IUserDisplayRulesService;

/**
 * 用户端显示规则Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-13
 */
@Service
public class UserDisplayRulesServiceImpl implements IUserDisplayRulesService
{
    @Autowired
    private UserDisplayRulesMapper userDisplayRulesMapper;

    /**
     * 通过id查询用户端显示规则
     *
     * @param id 用户端显示规则主键
     * @return 用户端显示规则
     */
    @Override
    public UserDisplayRules selectUserDisplayRulesById(Long id)
    {
        return userDisplayRulesMapper.selectUserDisplayRulesById(id);
    }

    /**
     * 查询用户端显示规则列表
     *
     * @param userDisplayRules 用户端显示规则
     * @return 用户端显示规则
     */
    @Override
    public List<UserDisplayRules> selectUserDisplayRulesList(UserDisplayRules userDisplayRules)
    {
        return userDisplayRulesMapper.selectUserDisplayRulesList(userDisplayRules);
    }

    /**
     * 新增用户端显示规则
     *
     * @param userDisplayRules 用户端显示规则
     * @return 结果
     */
    @Override
    public int insertUserDisplayRules(UserDisplayRules userDisplayRules)
    {
        userDisplayRules.setCreateTime(DateUtils.getNowDate());
        return userDisplayRulesMapper.insertUserDisplayRules(userDisplayRules);
    }

    /**
     * 修改用户端显示规则
     *
     * @param userDisplayRules 用户端显示规则
     * @return 结果
     */
    @Override
    public int updateUserDisplayRules(UserDisplayRules userDisplayRules)
    {
        userDisplayRules.setUpdateTime(DateUtils.getNowDate());
        return userDisplayRulesMapper.updateUserDisplayRules(userDisplayRules);
    }

    /**
     * 批量删除用户端显示规则信息
     *
     * @param ids 需要删除的用户端显示规则主键
     * @return 结果
     */
    @Override
    public int deleteUserDisplayRulesByIds(Long[] ids)
    {
        return userDisplayRulesMapper.deleteUserDisplayRulesByIds(ids);
    }

    /**
     * 删除用户端显示规则信息
     *
     * @param id 用户端显示规则主键
     * @return 结果
     */
    @Override
    public int deleteUserDisplayRulesById(Long id)
    {
        return userDisplayRulesMapper.deleteUserDisplayRulesById(id);
    }
}
